package com.test.netty;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        try {
            String host = "127.0.0.1";
            int port = 12345;
            NettyServer server = new NettyServer(port);
            server.run();
            Thread.sleep(1000);
            NettyClient client = new NettyClient(host, port);
            client.connect();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
